<template>
  <div>
    <ele-form
      :formDesc="formDesc"
      v-model="formData"
      :request-fn="handleRequest"
      @request-success="handleRequestSuccess"
    ></ele-form>
<!--    <el-card-->
<!--      header="ele-form-image-uploader 视频上传"-->
<!--      shadow="never"-->
<!--      style="max-width: 1250px;margin: 20px auto;"-->
<!--    >-->
<!--      <span>{{this.Stringmatch}}</span>-->
<!--      <ele-form-->
<!--        :form-data="formData"-->
<!--        :form-desc="formDesc"-->
<!--        :request-fn="handleRequest"-->
<!--        @request-success="handleSuccess"-->
<!--      />-->
<!--    </el-card>-->
  </div>

</template>

<script>
    export default {
        name: "UpVideo",
      props: {
        Stringmatch: ''
      },
      data () {
        return {
          formData: {},
          formDesc: {
            video: {
              label: '',
              type: 'video-uploader',
              attrs: {
                fileSize: 20000,
                action: 'http://localhost:8443/api/uploadVideo',
                responseFn (response, file) {
                  console.log(111)
                  console.log(response)
                  console.log(file)
                  return URL.createObjectURL(file.raw)
                }
              }
            }
          }
        }
      },
      methods: {
        // handleRequest (data) {
        //   console.log(data)
        //   return Promise.resolve()
        // },
        // handleSuccess () {
        //   this.$axios
        //     .post('/stringmatch', {
        //       stringmatch: this.Stringmatch
        //     })
        //     .then(successResponse => {
        //       if (successResponse.data.code === 200) {
        //         this.$message.success('匹配操作完成！')
        //       }
        //     })
        //     .catch(failResponse => {
        //     })
        // },
        handleRequest (data) {
          console.log(data)
          return Promise.resolve()
        },
        handleRequestSuccess () {
          this.$message.success('发送成功')
        }
      }

    }
</script>

<style scoped>
  .el-card{
    box-shadow: 0 1px 1px rgba(0,0,0,0.15) !important;
  }
</style>
